<template>
<h1>用户：{{ state && state.n }}</h1>
<button @click="clickHandle">修改姓名</button>
</template>

<script>
import { ref } from 'vue'
export default {
  name: 'App',
  setup() {
    const state = ref(null)

    const clickHandle = () => {
      state.value = { n: 123 }
      console.log(state)
    }

    return {
      state,
      clickHandle
    }
  }
}
</script>
